//
//  PainterViewController.m
//  mhome
//
//  Created by 刘春雷 on 2018/11/29.
//  Copyright © 2018年 刘春雷. All rights reserved.
//

#import "PainterViewController.h"

@interface PainterViewController ()
@property(nonatomic,strong)UIScrollView *scroll;

@end

@implementation PainterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"油漆工程";
    self.scroll = [[UIScrollView alloc]initWithFrame:CGRects(0, 0, 375, 667)];
    self.scroll.contentSize = CGSizeMake(0 , 1490*kHeightScale);
    self.scroll.backgroundColor = [UIColor whiteColor];
    self.scroll.pagingEnabled = NO;//是否允许整也翻
    self.scroll.bounces = NO;//关闭弹簧效果
    self.scroll.showsVerticalScrollIndicator = NO;//是否显示垂直滚动条
    [self.view addSubview:self.scroll];
    [self setUI];
}
    - (void)setUI {
        UIImageView*headImage=[[UIImageView alloc] initWithFrame:CGRects(0, 0, 375, 135)];
        headImage.backgroundColor = [UIColor grayColor];
        headImage.image=[UIImage imageNamed:@"construct-ban"];
        [self.scroll addSubview:headImage];
        for(int i = 0; i< 4;i++){
            UILabel*title=[[UILabel alloc ] init];
            title.font=[UIFont systemFontOfSize:20.0*BIZ];//字体大小
            [self.scroll addSubview:title];
            UILabel*content=[[UILabel alloc] init];
            content.numberOfLines = 0;
            content.font=[UIFont systemFontOfSize:13.0*BIZ];//字体大小
            content.textColor=[UIColor grayColor];
            [self.scroll addSubview:content];
            UIImageView*imgOne=[[UIImageView alloc] init];
            [self.scroll addSubview:imgOne];
            if(i == 0){
                title.frame = CGRects(15, 170, 300, 30);
                title.text=@"基层处理";
                content.frame = CGRects(15, 200, 345, 100);
                content.text= @" ● 石膏板接缝宜用石膏填补,并用绷带或布铺贴,防止开裂。\n ● 墙面开槽处,宜用嵌缝石膏粉补平,并用绷带或布铺贴,防止开裂。\n ● 新砌墙应铺贴网格布,防止开裂。";
                imgOne.frame = CGRects(20, 300, 335, 140);
                imgOne.image=[UIImage imageNamed:@"paint1"];
            }else if(i == 1){
                title.frame = CGRects(15, 460, 300, 30);
                title.text=@"墙顶面批嵌";
                content.frame = CGRects(15, 490, 345, 240);
                content.text=  @" ● 全屋宜使用阴阳角护角条,并用石膏腻子找方正。\n ● 未使用阴阳角护角条的地方,可按以下方式处理:\n （1）每个阴阳角要弹线,依据垂直线检查阴阳角处墙面平整度,其误差在5mm以内用墙衬找平,超过5mm必须用石膏找平。\n    (2）阴阳角找顺直,必须使其两侧墙面5米平整度达到标准（5米以内墙面平整垂直方向用2m靠尺检查,误差≤3mm,阴阳角处垂直度≤2mm。）\n ● 打磨时用灯光（灯泡功率≥200w)照射,无明显阴影和凹凸不平。\n ● 腻子干透后,用240以上型号的砂纸打磨平整。";
                imgOne.frame = CGRects(20, 730, 335, 140);
                imgOne.image=[UIImage imageNamed:@"paint2"];
            }else if(i == 2){
                title.frame = CGRects(15, 870, 300, 30);
                title.text=@"底漆涂刷及修补处理";
                content.frame = CGRects(15, 900, 345, 80);
                content.text= @"● 施工时,清理现场,尽量减少人员活动及粉尘二次污染。\n● 全屋底漆均匀涂刷,无漏刷。\n● 涂刷后进行全面检查,对流坠、漏刷及起皮进行处理。";
                imgOne.frame = CGRects(20, 980, 335, 140);
                imgOne.image=[UIImage imageNamed:@"paint3"];
            }else if (i == 3) {
                title.frame = CGRects(15, 1140, 300, 30);
                title.text=@"乳胶漆涂刷要求";
                content.frame = CGRects(15, 1170, 345, 100);
                content.text=@" ● 涂刷顺序:先顶后墙,朝一个方向涂刷。\n ● 全屋均匀涂刷,阴角处用排笔刷涂刷。\n ● 第二遍与第一遍交叉均匀涂刷,无漏刷、流坠等现象。\n ● 涂刷后进行检查,对流坠、漏刷进行处理。";
                imgOne.frame = CGRects(20, 1270, 335, 140);
                imgOne.image=[UIImage imageNamed:@"paint4"];
            }
            //改变label的间边距
            NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:content.text];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            [paragraphStyle setLineSpacing:6];
            [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [content.text length])];
            content.attributedText = attributedString;
        }
    }

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
